var t = getApp();

Page({
    data: {},
    onLoad: function(t) {
        wx.setNavigationBarTitle({
            title: "航班信息收集记录"
        }), this.getData();
    },
    goDetail: function(t) {
        console.log(t);
        var a = t.currentTarget.dataset.item;
        console.log(a), wx.navigateTo({
            url: "/packageH/flightInformation/flightInformationDetail/flightInformationDetail?id=" + a.id + "&form_id=" + a.form_id
        });
    },
    getData: function() {
        var a = this, e = t.getNetAddresss("plugin.flight-collect.frontend.index.get-flight");
        t._getNetWork({
            url: e,
            success: function(t) {
                var e = t.data;
                1 == e.result ? a.setData({
                    info: e.data.data,
                    current_page: e.data.current_page,
                    last_page: e.data.last_page
                }) : wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t.msg);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (!(this.data.current_page >= this.data.last_page)) {
            var t = this.data.page + 1;
            this.setData({
                page: t
            }), this.getMore();
        }
    },
    getMore: function() {
        var a = this, e = t.getNetAddresss("plugin.flight-collect.frontend.index.get-flight");
        t._getNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(t) {
                var e = t.data;
                1 == e.result ? a.setData({
                    info: a.data.info.concat(e.data.data),
                    current_page: e.data.current_page,
                    last_page: e.data.last_page
                }) : wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t.msg);
            }
        });
    },
    onShareAppMessage: function() {}
});